{extend name="common@base/common" /}
{block name="style"}
  <link href="__CSS__/main.min.css" type="text/css" rel="stylesheet">
{/block}
{block name="body"}
{include file="muushop/public/_nav"/}
<div id="main-container" class="container">
    <div class="col-md-2">
        <!--用户中心导航-->
        {include file="muushop/user/_nav"/}
    </div>
    <div class="col-md-10 user_common_section">
        <div class="common_box main_title">
            <h3>订单详情</h3>
        </div>

        <div class="clearfix">
            <div class="order-detail-box">
                <div class="common_box for-liucheng margin-top-10">

                    <div class="liulist for-cur"></div>
                    <div class="liulist {egt name='order.status' value='2'}for-cur{/egt}"></div>
                    <div class="liulist {egt name='order.status' value='3'}for-cur{/egt}"></div>
                    <div class="liulist {egt name='order.status' value='4'}for-cur{/egt}"></div>
                    <div class="liulist {egt name='order.status' value='12'}for-cur{/egt}"></div>  

                    <div class="liutextbox">
                    {switch name="$order.pay_type"}
                        {case value="0"}
                        <!--免费商品-->
                        <div class="liutext for-cur">
                            <em>1</em><br><strong>生成订单</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='2'}for-cur{/egt}">
                            <em>2</em><br><strong>无需付款</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='3'}for-cur{/egt}">
                            <em>2</em><br><strong>发货</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='4'}for-cur{/egt}">
                            <em>3</em><br><strong>确认收货</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='12'}for-cur{/egt}">
                            <em>4</em><br><strong>评价</strong>
                        </div>
                        {/case}
                        {case value="delivery"}
                        <!--货到付款-->
                        <div class="liutext for-cur">
                            <em>1</em><br><strong>生成订单</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='2'}for-cur{/egt}">
                            <em>2</em><br><strong>货到付款</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='3'}for-cur{/egt}">
                            <em>3</em><br><strong>发货</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='4'}for-cur{/egt}">
                            <em>4</em><br><strong>收货确认</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='12'}for-cur{/egt}">
                            <em>5</em><br><strong>完成评价</strong>
                        </div>
                        {/case}
                        {default /}
                        <!--在线支付-->
                        <div class="liutext for-cur">
                            <em>1</em><br><strong>生成订单</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='2'}for-cur{/egt}">
                            <em>2</em><br><strong>在线支付</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='3'}for-cur{/egt}">
                            <em>3</em><br><strong>发货</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='4'}for-cur{/egt}">
                            <em>4</em><br><strong>收货确认</strong>
                        </div>
                        <div class="liutext {egt name='order.status' value='12'}for-cur{/egt}">
                            <em>5</em><br><strong>完成评价</strong>
                        </div>
                    {/switch}
                    </div>
                </div>

                <div class="common_box order_orders margin-top-10">
                    <h3>订单信息</h3>
                    <!--订单、支付信息-->
                    <div class="box">
                        <p>订单号：{$order.order_no}</p>
                        <p>下单时间：{$order.create_time|time_format}</p>
                        {eq name="order.pay_type" value="onlinepay"}
                        <p>支付时间：{$order.paid_time|time_format}</p>
                        {/eq}
                    </div>
                </div>

            	<div class="common_box order_pay margin-top-10">
            		<h3>支付方式</h3>
            		<div class="box">
            			支付类型：{$order.pay_type_cn}<br>
            			支付方式：{$order.channel}
            		</div>
            	</div>

            	<div class="common_box order_address margin-top-10">
            		<h3>收货信息</h3>
            		<!--收货信息-->
                    <div class="box">
                		<p>买家：{$order.user_info.nickname}</p>
                		<p>收货人：{$order.address.name}</p>
                		<p>联系方式:{$order.address.phone} </p>
                		<p>收货地址：{$order['address']["province"]} {$order['address']["city"]} {$order['address']["district"]} {$order['address']["address"]}</p>
                    </div>
            	</div>

            	<div class="common_box order_procects margin-top-10">
            		<h3>商品信息</h3>
            		<!--商品信息-->
            		<table class="table table-bordered">
                        <thead>
                        <tr>
                            <th></th>
                            <th>商品</th>
                            <th>单价</th>
                            <th>数量</th>
                        </tr>
                        </thead>
                        <tbody>
                        	{volist name="order.products" id="vo"}
                            <tr data-type="normal_list">
                                <td>
                                    <div class="">
                                    	<img src="{$vo.main_img|getThumbImageById=100,100}" />
                                    </div>
                                </td>
                                <td>
                                    <div class="products_title">{$vo.title}</div>
                                    <div class="">
                                        {foreach name="vo.sku" item="sku"}
                                         <span class="sku_li_span">{$sku}</span>  
                                        {/foreach}
                                    </div>
                                </td>
                                <td>
                                    <div class="">{$vo.paid_price}</div>
                                </td>
                                <td>
                                    <div class="">{$vo.quantity}</div>
                                </td>
                            </tr>
                            {/volist}
                        </tbody>
                    </table>
            	</div>

                <div class="common_box order_all_price margin-top-10">
                    总价：<span>{$order.paid_fee}</span> 
                    邮费：<span>{$order.delivery_fee}</span> 
                    已优惠价格：<span>{$order.discount_fee}</span>
                </div>

                {egt name='order.status' value='3'}
                <!--物流查询-->
                <div class="common_box order_delivery_info margin-top-10">
                    {notempty name="delivery"}

                        {notempty name="order.delivery_info"}
                        {:hook('express',['orderCode'=>$order.order_no,'shipperCode'=>$order.delivery_info.ShipperCode,'logisticCode'=>$order.delivery_info.LogisticCode])}
                        {else /}
                        <p>物流数据不存在，可能商家还未发货</p>
                        {/notempty}
                    {else /}
                        <p>还未配置物流插件！</p>
                    {/notempty}
                </div>
                {/egt}

                <div class="common_box operate margin-top-10">
                    {switch name="order.status"}
                    {case value="1"}
                    <a href="{:url('muushop/order/pay',['order_no'=>$order['order_no']])}" class="btn btn-success btn-block" data-toggle="pay_order">
                        立即支付
                    </a>
                    <a class="btn btn-warning btn-block" data-toggle="cannel_order" data-id="{$order.id}" data-url="{:url('muushop/Api/order',['action'=>'cannel'])}">
                        取消订单
                    </a>
                    {/case}
                    {case value="2"}
                    {eq name="order.pay_type" value="delivery"}
                        
                    {/eq}
                    <a class="btn btn-block disabled">
                        配货中
                    </a>
                    {/case}
                    {case value="3"}
                    <a target="_blank" class="btn btn-danger btn-block" data-toggle="do_receipt" data-id={$order.id} data-url="{:url('muushop/Api/order',['action'=>'confirm'])}">
                        确认收货
                    </a>
                    {/case}
                    {case value="4"}
                    <a class="btn btn-info btn-block" href="{:url('muushop/User/comment',array('id'=>$order['id']))}">
                        评价
                    </a>
                    {/case}
                    
                    {case value="12"}
                    <a class="btn btn-block disabled">
                        已评价
                    </a>
                    {/case}
                        
                    {/switch}
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script src="__JS__/common.min.js"></script>
<script src="__JS__/user.min.js"></script>
{/block}